<script setup>
  import { ref, watch } from 'vue';
  import event from '../tools/event';
  import '../style/textarea.css';

  const props = defineProps({
    propContent: String,
    isReadonly: Boolean,
    addStyle: Object,
  });

  let textAreaContent = ref(props.propContent);

  watch(textAreaContent, (val) => {
    event.emit('textarea-change', val);
  });
</script>

<template>
  <div class="el-textarea">
    <textarea
      class="el-textarea__inner__1"
      :readonly="isReadonly"
      wrap="off"
      v-model="textAreaContent"
      :style="addStyle"
      placeholder="说明"
    />
  </div>
</template>
